#!/bin/sh
CUR_DIR=$(pwd)
echo CUR_DIR:${CUR_DIR}

sudo apt-get install -y lsb-release
Codename=$(lsb_release -a | grep Codename: | awk '{print $2}')
echo OS Codename is $Codename

echo begin generate sources.list, user aliyun mirror
if [ -f "${CUR_DIR}/sources_list" ];then
  echo file sources_list exist, delete it
  sudo rm -f sources_list
fi
sed "s/focal/${Codename}/g" ./sources.list > sources_list
echo end generate sources.list, user aliyun mirror

echo begin replace sources.list
if [ ! -f "/etc/apt/sources.list.bak" ];then
  echo backup file sources.list
  sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
fi
sudo cp ./sources_list /etc/apt/sources.list
echo end replace sources.list
sudo apt-get update
sudo apt-get install -y cmake g++
sudo apt-get install -y openssh-server
sudo apt-get install -y ctags cscope

cp .vimrc ~/
cp -R .vim ~/
#git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
git clone https://gitee.com/gid5564/vundle.git ~/.vim/bundle/vundle

git config --global credential.helper store
